home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Utilities / Ghostscript / src / iminst.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-01  |  3.4 KB  |  92 lines

  1. /* Copyright (C) 1995, 1996, 1997, 1998, 1999 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of AFPL Ghostscript.
  4.   
  5.   AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
  6.   distributor accepts any responsibility for the consequences of using it, or
  7.   for whether it serves any particular purpose or works at all, unless he or
  8.   she says so in writing.  Refer to the Aladdin Free Public License (the
  9.   "License") for full details.
  10.   
  11.   Every copy of AFPL Ghostscript must include a copy of the License, normally
  12.   in a plain ASCII text file named PUBLIC.  The License grants you the right
  13.   to copy, modify and redistribute AFPL Ghostscript, but only under certain
  14.   conditions described in the License.  Among other things, the License
  15.   requires that the copyright notice and this notice be preserved on all
  16.   copies.
  17. */
  18.  
  19. /*$Id: iminst.h,v 1.2 2000/09/19 19:00:45 lpd Exp $ */
  20. /* Definition of interpreter instance */
  21. /* Requires stdio_.h, gsmemory.h, iref.h */
  22.  
  23. #ifndef iminst_INCLUDED
  24. #  define iminst_INCLUDED
  25.  
  26. #ifndef gs_main_instance_DEFINED
  27. #  define gs_main_instance_DEFINED
  28. typedef struct gs_main_instance_s gs_main_instance;
  29. #endif
  30.  
  31. /*
  32.  * Define the structure of a search path.  Currently there is only one,
  33.  * but there might be more someday.
  34.  *
  35.  *      container - an array large enough to hold the specified maximum
  36.  * number of directories.  Both the array and all the strings in it are
  37.  * in the 'foreign' VM space.
  38.  *      list - the initial interval of container that defines the actual
  39.  * search list.
  40.  *      env - the contents of an environment variable, implicitly added
  41.  * at the end of the list; may be 0.
  42.  *      final - the final set of directories specified in the makefile;
  43.  * may be 0.
  44.  *      count - the number of elements in the list, excluding a possible
  45.  * initial '.', env, and final.
  46.  */
  47. typedef struct gs_file_path_s {
  48.     ref container;
  49.     ref list;
  50.     const char *env;
  51.     const char *final;
  52.     uint count;
  53. } gs_file_path;
  54.  
  55. /*
  56.  * Here is where we actually define the structure of interpreter instances.
  57.  * Clients should not reference any of the members.  Note that in order to
  58.  * be able to initialize this structure statically, members including
  59.  * unions must come last (and be initialized to 0 by default).
  60.  */
  61. struct gs_main_instance_s {
  62.     /* The following are set during initialization. */
  63.     FILE *fstdin;
  64.     FILE *fstdout;
  65.     FILE *fstderr;
  66.     bool stdin_is_interactive;
  67.     gs_memory_t *heap;        /* (C) heap allocator */
  68.     uint memory_chunk_size;    /* 'wholesale' allocation unit */
  69.     ulong name_table_size;
  70.     uint run_buffer_size;
  71.     int init_done;        /* highest init done so far */
  72.     int user_errors;        /* define what to do with errors */
  73.     bool search_here_first;    /* if true, make '.' first lib dir */
  74.     bool run_start;        /* if true, run 'start' after */
  75.                 /* processing command line */
  76.     gs_file_path lib_path;    /* library search list (GS_LIB) */
  77.     long base_time[2];        /* starting usertime */
  78.     void *readline_data;    /* data for gp_readline */
  79.     /* The following are updated dynamically. */
  80.     i_ctx_t *i_ctx_p;        /* current interpreter context state */
  81. };
  82.  
  83. /*
  84.  * Note that any file that uses the following definition of default values
  85.  * must include gconfig.h, because of SEARCH_HERE_FIRST.
  86.  */
  87. #define gs_main_instance_default_init_values\
  88.   0, 0, 0, 1 /*true*/, 0, 20000, 0, 0, -1, 0, SEARCH_HERE_FIRST, 1
  89. extern const gs_main_instance gs_main_instance_init_values;
  90.  
  91. #endif /* iminst_INCLUDED */
  92.